﻿using BluetoothMachine.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BluetoothMachine.Models
{
    /// <summary>
    /// 设备数据模型
    /// </summary>
    public class DeviceConfigModel : INotifyPropertyChanged
    {
        /// <summary>
        /// 序号----用于排序
        /// </summary>
        public int SerialNumber { get; set; }
        /// <summary>
        /// IP地址或者端口号
        /// </summary>
        public string Address { get; set; }
        /// <summary>
        /// 端口号
        /// </summary>
        public int Port { get; set; }
        /// <summary>
        /// 设备类型
        /// </summary>
        public DeviceType DeviceTypes { get; set; }
        /// <summary>
        /// 是否是串口
        /// </summary>
        public bool IsPort { get; set; } = true;
        /// <summary>
        /// 奇偶校验位
        /// </summary>
        public Parity SParity { get; set; } = Parity.Even;

        /// <summary>
        /// 每个字节的标准数据位长度
        /// </summary>
        public int DataBits { get; set; } = 8;
        /// <summary>
        /// 停止位的数目
        /// </summary>
        public StopBits SStopBits { get; set; } = StopBits.One;

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
